package com.enation.framework.util;

import org.springframework.stereotype.Component;

import com.enation.framework.context.spring.SpringContextHolder;
import com.enation.framework.image.IUploader;

@Component
public class UploadFacatory {

	private UploadFacatory() {
	}

	/**
	 * 上传图片
	 * 
	 * @return
	 */
	public static IUploader getUploaer() {
		IUploader uploade = (IUploader) SpringContextHolder
				.getBean("localUploader");
		int isopen = ClusterSetting.getFdfs_open();
		if (isopen == 1) {
			return new FastDFSUploader();
		}
		return uploade;
	}

}
